<?php


namespace core\event;


use core\entity\Group;
use core\entity\GroupUser;
use core\entity\Message;
use core\entity\User;
use core\entity\UserFactory;

class EventGroupMessage extends EventMessage {

    /**
     * @var Group
     */
    protected $group;

    public function __construct(array $input) {
        parent::__construct($input);
        $this->sender = UserFactory::build($this->message_type, $input['sender']);
        $this->group = new Group($input['group_id']);
    }

    public function getGroup(): Group {
        return $this->group;
    }

}
